<template>
  <div>
    <div @click="jump">函数路由跳转页面</div>
  </div>
</template>

<script>
import { reactive, ref, toRefs } from "vue";
import { useRouter } from "vue-router";
export default {
  name: "函数路由跳转",
  // 定义模板
  components: {},
  //在创建组件之前执行
  setup(props, context) {
    const state = reactive({
      name: "你好",
    });
    const num = ref(0);

    const router = useRouter()
    const jump = () => {
      router.push({path:'/hslytzym',query:{name:'路由query传参'}})
    }

    
    return {
      ...toRefs(state),
      num,
      jump
    };
  },
};
</script>
<style scoped lang ='less'>
</style>